package cpr.view;

import java.util.Iterator;
import java.util.List;

import javax.swing.JComboBox;

@SuppressWarnings({ "unchecked", "rawtypes" })
public class EntityComboBox<T> extends JComboBox 
{
	private static final long serialVersionUID = 1L;

	public void setItems (List<T> objetos)
	{
		this.removeAllItems();
		
		for (Iterator<T> iterator = objetos.iterator(); iterator.hasNext();) 
		{
			this.addItem(iterator.next());
		}
	}
	
	public T getSelectedItem()
	{
		return (T)super.getSelectedItem();
	}
}
